|
Lemon is a parser generator, maintained as part of the SQLite project, that generates an LALR parser in the C programming language from an input context-free grammar. The generator is quite simple, implemented in a single C source file with another file used as a template for output. Lexical analysis is performed externally. Lemon is similar to bison and yacc; however it is not compatible with these programs. The grammar input format is different, so as to help prevent common coding errors. Other distinctive features include a reentrant, thread-safe output parser, and the concept of "non-terminal destructors" that try to make it easier to avoid leaking memory. SQLite uses Lemon with a hand-coded tokenizer to parse SQL strings. In 2008 a Lemon-generated parser was suggested to replace the bison-generated parser used for the PHP programming language; this project was listed as "in the works". Lemon, in combination with re2c and a re2c wrapper called Perplex, are used〔http://sourceforge.net/p/brlcad/code/HEAD/tree/brlcad/trunk/misc/tools/lemon/〕〔http://sourceforge.net/p/brlcad/code/HEAD/tree/brlcad/trunk/misc/tools/re2c/〕〔http://sourceforge.net/p/brlcad/code/HEAD/tree/brlcad/trunk/misc/tools/perplex/〕 in BRL-CAD as platform-agnostic and easily compilable alternatives to Flex and Bison. This combination is also used with STEPcode.〔http://stepcode.org/docs/build_process/〕 ==Notes== 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Lemon Parser Generator」の詳細全文を読む スポンサード リンク
|